fix: repair cross-package bugs so all tests and tsc pass - #102
Open
stooit wants to merge 1 commit into
Open
Conversation
- api.ts: update stale import after hook rename (useThrottle -> useDebounce); useThrottle no longer exists in @e2e/utils, useDebounce is the compatible export - date.ts: use Intl formatToParts to emit day without leading zero (1/03/2024) - Button.tsx: add aria-label fallback for icon-only buttons (WCAG 4.1.2), scoped to iconOnly so text buttons keep their visible label as accessible name - DataTable.tsx: use functional setState in sort toggle to harden against React 18 auto-batching (defensive; real test failure was the missing DOM env) - bunfig.toml: add happy-dom preload so React component tests have a document - tsconfig.json: add bun-types so bun:test declarations resolve
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes all failing tests and type errors across the monorepo. Bugs spanned all three packages plus test/build config.
bun test→ 13 pass / 0 fail;tsc --noEmit→ clean. No test files or dependencies were changed.Fixes
apps/web/src/lib/api.tsuseThrottlefrom@e2e/utils, which was renamed and no longer exported (TS2305)useDebounceexportpackages/utils/src/format/date.tsformatDateemitted a leading-zero day (01/03/2024), failing the "day 1 not confused with month 1" assertion (/^1/)Intlparts so the day has no leading zero (1/03/2024)packages/ui/.../Button.tsxaria-label(WCAG 2.2 AA 4.1.2)aria-labelfallback scoped toiconOnlyso text buttons keep their visible label as the accessible namepackages/ui/.../DataTable.tsxsetStateto harden against React 18 auto-batching (defensive)bunfig.tomldocument is not definedhappy-dompreloadtsconfig.jsonbun:testtype declarations unresolved (TS2307)bun-typesVerification
bun test(from repo root): 13 pass / 0 failnpx tsc --noEmit: exit 0, no errorsNotes / assumptions
bunfig.toml(thepackages/uione already had it). TheDataTablefunctional-setState change is defensive hardening and independently correct.formatDateuses local time. This is TZ-sensitive at extreme offsets (> UTC+12) but correct for the test's fixtures and standard CI/AU environments.